<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<h4>users数据库的数据列表</h4>
<table class="table table-bordered table-hover">
    <thead class="table-dark">
        <tr>
            <td>编码</td>
            <td>姓名</td>
            <td>登录名</td>
            <td>性别</td>
        </tr>
    </thead>
    <tbody>
        <%
            List<User> list = (List<User>) request.getAttribute("userList");
            for (int i = 0; i < list.size(); i++) {
        %>
        <tr>
            <td><%= list.get(i).getId() %></td>
            <td><%= list.get(i).getName() %></td>
            <td><%= list.get(i).getUsername() %></td>
            <td>
                <%
                    if(list.get(i).getSex()==0){
                        out.print("未知");
                    }else if(list.get(i).getSex()==1){
                        out.print("男");
                    }else if(list.get(i).getSex()==2){
                        out.print("女");
                    }
                %>
            </td>
        </tr>
        <%
            };
        %>
    </tbody>
</table>
